package live.zs.mybatisplusboot.controller;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import live.zs.mybatisplusboot.entity.TbUser;
import live.zs.mybatisplusboot.service.ITbUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 * 自定义配置BiConsumer tableInfo comment 前端控制器
 * </p>
 *
 * @author madison
 * @since 2021-07-09 13:43:22
 */
@RestController
@RequestMapping("/tbUser")
public class TbUserController {

    @Autowired
    private ITbUserService userService;

    @GetMapping("list")
    public PageDTO<TbUser> list(@RequestBody(required = false) PageDTO pageDTO) {
//        PageDTO page = userService.page(pageDTO);
        return userService.userList(pageDTO);
    }

    @PutMapping("save")
    public boolean save(@RequestBody TbUser user) {
        return userService.saveOrUpdate(user);
    }
}

